package com.speed_run.utils;

import com.speed_run.config.Api;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.ToString;


@AllArgsConstructor
@NoArgsConstructor
@ToString
public class Result<T> {
	
	@Getter
	private int code;
	
	@Getter
	private String msg;
	
	@Setter
	@Getter
	private T data;
	
	public Result<T> api(Api api){
		this.code=api.code();
	    this.msg=api.msg();
	    return this;
	}
	
	public static void main(String[] args) {
			Result<String> t = new Result<String>().api(Api.SERVRE_ERROR);
	}
}
